import request from '@/utils/request';

// 利用code请求后端
export function queryLoginWithCode(body: API.LoginParam) {
	return request<API.LoginResponse>({
		url: '/api/wechat/login',
		method: 'POST',
		body
	});
}

// 用户注册
export function queryRegister(body: API.RegisterParam) {
	return request<API.RegisterResponse>({
		url: '/api/wechat/register',
		method: 'POST',
		body
	});
}

// 获取当前用户信息
export function queryMe() {
	return request<API.UserInfoResponse>({
		url: '/api/me',
		method: 'GET'
	});
}
